package kr.hkit.powerjava.chapter21;

public class ArrayError {
	public static void main(String[] args) {
		int[] array = { 1, 2, 3, 4, 5 };
		int i = 0;
		try {
			for (; i < array.length + 1; i++)
				System.out.println(array[i] + " ");
		} catch (/*ArrayIndexOutOfBoundsException*/Exception e) {
			System.out.println("인덱스 " + i + "는 사용할수 없습니다."+e.getMessage()/*e.getLocalizedMessage()*/);
			e.printStackTrace();
			
		}

	}

}
